
#ifndef   __RF_REMOTE_MANAGER_H_
#define   __RF_REMOTE_MANAGER_H_

#include "RF_RX.h"

#define   RF_INPUT_MESSAGE_SIZE				31

#define   LIST_RF_REMOTE						EX_ADDR_LIST_RF_REMOTE
#define   LIST_RF_INPUTS_DESCRIPTORS		EX_ADDR_RF_INPUTS_DESCRIPTORS
#define   COUNT_RF_REMOTE						10
#define   COUNT_RF_INPUTS_DESCRIPTORS		16

#define   RF_INPUT_DESCRIPTOR_MESSAGES_COUNT		3

typedef struct
{
		unsigned Transmit	: 1;

}SPECIAL_FUNCTION;

typedef struct 
{
	unsigned int ID;
	unsigned char Button;
	unsigned char rez;
	SPECIAL_FUNCTION Special;
}RECORD_RF_REMOTE;

typedef struct
{
		unsigned char Button;
		unsigned char OutputNumber;
		unsigned int OutputType;  /* Output type: LOW(0), HIGH(1), PULSE(>1)  */
		unsigned char Message[RF_INPUT_DESCRIPTOR_MESSAGES_COUNT][RF_INPUT_MESSAGE_SIZE+1];
}RF_INPUT_DESCRIPTOR;


enum
{
	TIMEOUT__RF_Input_Handler = -10,
	RF_INPUT_IS_NOT_DEFINED
};

#define   RF_REMOTE_TRANSMIT		1


extern unsigned char RF_Message[RF_BUFFER_SIZE];
extern near bit RF_MESSAGE_RECEIVED;
extern unsigned char RF_Errors;
extern near unsigned char RF_LearnParameters;

void RF_LearMode ( void );
void RF_Manager ( void );
void RF_Get_Button ( RECORD_RF_REMOTE* Record_RF_Remote );
//unsigned char RF_Input_Handler ( unsigned char Input );
void Drive_RF_Input ( void );

#endif
